package com.frejoys.common.dto.admin;

import com.frejoys.common.error.HttpStatus;
import com.frejoys.common.exception.GeneralException;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class AgentRoleGroupRatioDto {

    @Schema(type = "Float", name = "commissionRatio", description = "佣金比例占推广比例的百分比", required = true, defaultValue = "1")
    private Float commissionRatio;

    @Schema(type = "Float", name = "agentUserRatio", description = "代理人分成比例", required = true, defaultValue = "1")
    private Float agentUserRatio;

    @Schema(type = "Float", name = "agentUserRatioOne", description = "代理一级推荐分成比例", required = true, defaultValue = "1")
    private Float agentUserRatioOne;

    @Schema(type = "Float", name = "agentUserRatioTwo", description = "代理二级推荐分成比例", required = true, defaultValue = "1")
    private Float agentUserRatioTwo;

    @Schema(type = "Float", name = "platformRatio", description = "平台比例", required = true, defaultValue = "1")
    private Float platformRatio;

    public Float getCommissionRatio() {
        if (this.commissionRatio == null){
            throw new GeneralException(HttpStatus.argumentNotValid);
        }
        return commissionRatio;
    }

    public Float getAgentUserRatio() {
        if (this.agentUserRatio == null){
            throw new GeneralException(HttpStatus.argumentNotValid);
        }
        return agentUserRatio;
    }

    public Float getAgentUserRatioOne() {
        if (this.agentUserRatioOne == null){
            throw new GeneralException(HttpStatus.argumentNotValid);
        }
        return agentUserRatioOne;
    }

    public Float getAgentUserRatioTwo() {
        if (this.agentUserRatioTwo == null){
            throw new GeneralException(HttpStatus.argumentNotValid);
        }
        return agentUserRatioTwo;
    }

    public Float getPlatformRatio() {
        if (this.platformRatio == null){
            throw new GeneralException(HttpStatus.argumentNotValid);
        }
        return platformRatio;
    }
}
